package com.knight.service;


import com.jfinal.plugin.activerecord.Page;
import com.knight.model.Content;

public class ContentService {
	private static ContentService instance = new ContentService();

	private ContentService() {
	}

	public static ContentService getInstance() {
		return instance;
	}

	private static final Content dao = new Content().dao();

	public Page<Content> findByTypeForPage(int pageNumber, int pageSize, String type) {
		return dao.paginate(pageNumber, pageSize, "SELECT id,title,createDate ", " FROM content WHERE TYPE = " + type+" ORDER BY createDate DESC");
	}
	
	
	public Content findById(Object id){
		return dao.findById(id);
	}
}
